package io;

import java.io.*;

public class CopyDemo03 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis  = new FileInputStream("String.png");
        BufferedInputStream bit = new BufferedInputStream(fis);//高级流
        FileOutputStream fos = new FileOutputStream("String03.png");
        BufferedOutputStream bot = new BufferedOutputStream(fos);//高级流
        int d;
        long start = System.currentTimeMillis();
        while ((d = bit.read())!=-1){
            bot.write(d);
        }
        long end = System.currentTimeMillis();
        System.out.println("文件复制完毕,耗时"+(end-start)+"毫秒");
        bit.close();
        bot.close();
    }

}
